package dao

import (
	"github.com/jmoiron/sqlx"
)

var Db *sqlx.DB

func init() {
	dsn := "root:root!@#@tcp(www.zhuanyi.tech:3306)/to_blog?charset=utf8mb4&parseTime=True"
	database, err := sqlx.Connect("mysql", dsn)
	if err != nil {
		panic(err)
		return
	}
	database.SetMaxOpenConns(20)
	database.SetMaxIdleConns(10)
	Db = database
}
